/* eslint-disable */
// 该文件由 OneAPI 自动生成，请勿手动修改！
import { request } from '@umijs/max';

export async function queryComponList(params: Global.pageParams) {
  return request<Global.Result<Compon.ComponEntity[]>>(
    '/api/queryPermissionList',
    {
      method: 'post',
      params,
    },
  );
}

export async function addCompon(data: Compon.ComponEntity) {
  return request<Global.Result<Compon.ComponEntity>>('/api/createPermission', {
    method: 'post',
    data,
  });
}

export async function editCompon(data: Compon.ComponEntity) {
  return request<Global.Result<Compon.ComponEntity>>(`/api/updatePermission`, {
    method: 'patch',
    data: data,
  });
}

export async function delCompon(data: Pick<Compon.ComponEntity, 'id'>) {
  const { id } = data;
  return request<Global.Result<Compon.ComponEntity>>(
    `/api/destroyPermission/${id}`,
    {
      method: 'delete',
    },
  );
}
